﻿<%@ Page Title="" Language="VB" MasterPageFile="~/Master/Site.master" AutoEventWireup="false"
    ValidateRequest="false" CodeFile="MyAssociate.aspx.vb" Inherits="private_secure_members_manage_Associate" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="Server">
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
        .style2
        {
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
    <h2>
        Manage Associates/Staff Logins</h2>
    <h3>
        Assign Your Associates (STAFF) To Manage your Business</h3>
    <hr />
    <br />
    <table id="table1" class="style1">
        <tr>
            <td valign="top" class="style2" colspan="2">
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
        <tr>
            <td valign="top" class="style2">
                Select an Organisation or Business
            </td>
            <td>
                <asp:Label ID="Label1" runat="server" Text="Check to &lt;b&gt;assign&lt;/b&gt; your Associated to your selected business"></asp:Label>
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
        <tr>
            <td valign="top" class="style2">
                <asp:GridView ID="grdEntities" runat="server" AllowSorting="True" AutoGenerateColumns="False"
                    DataKeyNames="ID" DataSourceID="SqlEntities_ds" AllowPaging="True" Width="460px"
                    CellPadding="4" ForeColor="#333333">
                    <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                    <Columns>
                        <asp:CommandField ShowSelectButton="True" />
                        <asp:BoundField DataField="RowNum" HeaderText="#" ReadOnly="True" SortExpression="RowNum" />
                        <asp:BoundField DataField="ID" HeaderText="ID" SortExpression="ID" InsertVisible="False"
                            ReadOnly="True" Visible="False" />
                        <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
                        <asp:BoundField DataField="EntityType" HeaderText="Entity Type" SortExpression="EntityType" />
                    </Columns>
                    <EditRowStyle BackColor="#999999" />
                    <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                    <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                    <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                    <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                    <SortedAscendingCellStyle BackColor="#E9E7E2" />
                    <SortedAscendingHeaderStyle BackColor="#506C8C" />
                    <SortedDescendingCellStyle BackColor="#FFFDF8" />
                    <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
                </asp:GridView>
                <asp:SqlDataSource ID="SqlEntities_ds" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationServices %>"
                    SelectCommand="usp_GetEntityListInfo_EntityType_ByUserId" SelectCommandType="StoredProcedure">
                    <SelectParameters>
                        <asp:Parameter DbType="Guid" Name="UserId" />
                    </SelectParameters>
                </asp:SqlDataSource>
            </td>
            <td valign="top">
                <asp:Panel ID="Panel1" runat="server">
                    <asp:GridView ID="grdAssignables" runat="server" AllowSorting="True" AutoGenerateColumns="False"
                        DataKeyNames="Id" DataSourceID="SqlAssignableAssociates_ds" CellPadding="4" ForeColor="#333333"
                        ToolTip="Your List of Associates - Assign to your selected Business " Width="400px">
                        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                        <Columns>
                            <asp:BoundField DataField="RowNum" HeaderText="#" ReadOnly="True" SortExpression="RowNum" />
                            <asp:BoundField DataField="Id" HeaderText="Id" SortExpression="Id" InsertVisible="False"
                                ReadOnly="True" Visible="False" />
                            <asp:BoundField DataField="FirstName" HeaderText="First Name" SortExpression="FirstName" />
                            <asp:BoundField DataField="LastName" HeaderText="Last Name" SortExpression="LastName" />
                            <asp:BoundField DataField="MiddleInitial" HeaderText="Initials" SortExpression="MiddleInitial" />
                            <asp:BoundField DataField="DisplayName" HeaderText="Display Name" SortExpression="DisplayName"
                                Visible="False" />
                            <asp:BoundField DataField="AssociateId" HeaderText="AssociateId" SortExpression="AssociateId"
                                Visible="False" />
                            <asp:TemplateField HeaderText="Assign">
                                <EditItemTemplate>
                                    <asp:CheckBox ID="CheckBox1" runat="server" />
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:CheckBox ID="CheckBox1" runat="server" />
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                        <EditRowStyle BackColor="#999999" />
                        <EmptyDataTemplate>
                            There are no Associates at this time that can be assigned to the selected entity.
                        </EmptyDataTemplate>
                        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                        <SortedAscendingCellStyle BackColor="#E9E7E2" />
                        <SortedAscendingHeaderStyle BackColor="#506C8C" />
                        <SortedDescendingCellStyle BackColor="#FFFDF8" />
                        <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
                    </asp:GridView>
                    <asp:SqlDataSource ID="SqlAssignableAssociates_ds" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationServices %>"
                        SelectCommand="usp_GetAllAssociatesList_ByEntityId" SelectCommandType="StoredProcedure">
                        <SelectParameters>
                            <asp:ControlParameter ControlID="grdEntities" Name="EntityId" PropertyName="SelectedValue"
                                Type="Int32" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                    <asp:Button ID="btnUnassign" runat="server" Text="Assign Associate" />
                    <asp:Button ID="btnDeleteAssociate" runat="server" Text="Delete Associate" />
                    <br />
                </asp:Panel>
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
        <tr>
            <td valign="top" class="style2">
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
        <tr>
            <td class="style2" valign="top">
                <asp:Label ID="Label2" runat="server" Text="Check to &lt;b&gt;Unassign&lt;/b&gt; Associates from your business"></asp:Label>
            </td>
            <td valign="top">
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
        <tr>
            <td class="style2">
                <asp:Panel ID="Panel2" runat="server">
                    <asp:GridView ID="grdAssociates" runat="server" AllowPaging="True" AllowSorting="True"
                        AutoGenerateColumns="False" CellPadding="4" DataKeyNames="Id" DataSourceID="SqlAssociates_ds0"
                        ForeColor="#333333" Width="460px">
                        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                        <Columns>
                            <asp:BoundField DataField="Rownum" HeaderText="#" ReadOnly="True" SortExpression="Rownum" />
                            <asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False" ReadOnly="True"
                                SortExpression="Id" Visible="False" />
                            <asp:BoundField DataField="FirstName" HeaderText="First Name" SortExpression="FirstName" />
                            <asp:BoundField DataField="LastName" HeaderText="Last Name" SortExpression="LastName" />
                            <asp:BoundField DataField="MiddleInitial" HeaderText="Initials" SortExpression="MiddleInitial" />
                            <asp:BoundField DataField="DisplayName" HeaderText="Display Name" SortExpression="DisplayName"
                                Visible="False" />
                            <asp:TemplateField HeaderText="Unassign">
                                <EditItemTemplate>
                                    <asp:CheckBox ID="CheckBox2" runat="server" />
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:CheckBox ID="CheckBox3" runat="server" />
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                        <EditRowStyle BackColor="#999999" />
                        <EmptyDataTemplate>
                            So far you have no Associates for your business. You must first
                            <asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl="~/private/secure_admin/AssociateLoginRequest.aspx">Request An Associate Login</asp:HyperLink>
                            &nbsp;to get started.
                        </EmptyDataTemplate>
                        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                        <SortedAscendingCellStyle BackColor="#E9E7E2" />
                        <SortedAscendingHeaderStyle BackColor="#506C8C" />
                        <SortedDescendingCellStyle BackColor="#FFFDF8" />
                        <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
                    </asp:GridView>
                    <asp:SqlDataSource ID="SqlAssociates_ds" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationServices %>"
                        SelectCommand="usp_GetAssociatesListByEntityId" SelectCommandType="StoredProcedure">
                        <SelectParameters>
                            <asp:ControlParameter ControlID="grdEntities" Name="EntityId" PropertyName="SelectedValue"
                                Type="Int32" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                    <asp:SqlDataSource ID="SqlAssociates_ds0" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationServices %>"
                        SelectCommand="usp_GetAssociatesListByEntityId" SelectCommandType="StoredProcedure">
                        <SelectParameters>
                            <asp:ControlParameter ControlID="grdEntities" Name="EntityId" PropertyName="SelectedValue"
                                Type="Int32" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                    <br />
                    <asp:Button ID="btnAssign" runat="server" Text="UnAssign Associate" />
                </asp:Panel>
                <br />
            </td>
            <td valign="top">
                Other Available Options<br />
                <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/private/secure_admin/AssociateLoginRequest.aspx">Request Another Associate Login</asp:HyperLink>
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
        <tr>
            <td class="style2">
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
    </table>
</asp:Content>
